Bug/#71 fix undefined import modules#80
Open
BSteffaniak wants to merge 7 commits into
Open
Conversation
8ffee7f to
ca8fa6d
Compare
ca8fa6d to
0feaff2
Compare
mikedownesdev
added a commit
to mikedownesdev/gas-svelte-app
that referenced
this pull request
Sep 27, 2023
Importing a function from another file the way I've been trying to does not work. I've followed up on a GitHub issue / PR on this topic: issue: grant/ts2gas#71 PR: grant/ts2gas#80 Going to try this `namespace` workaround next: https://github.com/google/clasp/blob/master/docs/typescript.md#the-exports-declaration-workaround Which names this useful respository for inspiration: https://github.com/PopGoesTheWza/ts-gas-project-starter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi again, this is my naive attempt at fixing #71.
This PR is based on top of #79, so a lot of the file changes may appear duplicated from there.
I'm not sure if my implementation in

index.ts#createMockModuleImportStatementis the idiomatic way to achieve this functionality, but it seems to be working for the previous test cases and the few new test cases I have added:Here is an example typescript input:
and with this PR, the produced output looks like this:
I'm also not sure what determines the suffix on the module names (e.g. the
_1part ofbob_1), so it's just hardcoded to that currently.Again, I'm not super familiar with the typescript compiler structure, so let me know if this is completely incorrect.
Thanks!